package com.wontube.audio.pub;

import java.util.HashMap;

import com.wontube.client.remote.IRemotingCreateListener;
import com.wontube.client.remote.Remoting;

/**
 * @author yuechao
 *
 */
public class RemotingCreateListener implements IRemotingCreateListener {
	@Override
	public void onCreate(Remoting<?> remoting) {
		HashMap<String, String> header = RequestHeadersHolder.holder.getHeader();
		
		String sessionId = header.get(RequestHeadersHolder.sessionKey);
		String realIP = header.get(RequestHeadersHolder.ipKey);
		
		remoting.setClientSessionId(sessionId);
		remoting.getRequestExtHeaders().put(RequestHeadersHolder.ipKey, realIP);
	}
}
